package dao;

import java.io.FileInputStream;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;

public abstract class DAO {
	  static {
		  
		    try{
		    	
		        Properties properties = new Properties();
			    properties.load(new FileInputStream("properties\\database.properties"));
			     
			    String driver = properties.getProperty("driver");
			    System.out.println("----------"+driver+"------------");
			    String url = properties.getProperty("url");
			    String username = properties.getProperty("username");
			    String password = properties.getProperty("password");
			    
		        new pool.JDCConnectionDriver(driver, url, username, password);
	        }
		    catch(Exception e){
	        	
	        	e.printStackTrace();
	        }
	  }

	  public Connection getConnection() 
	                      throws SQLException{
	        return DriverManager.getConnection(
					"jdbc:jdc:jdcpool");
	  }

}
